package org.four;

/**
 * Created by Administrator on 2016/3/14 0014.
 */
public class TestRunnableThread implements Runnable {
    @Override
    public void run() {
        for ( int i = 0; i < 10; i++ ) {
            System.out.println(Thread.currentThread().getName() + "当前值：" + i);
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

class TestRunnable {
    public static void main(String[] args) {
        TestRunnableThread r = new TestRunnableThread();
        new Thread( r, "线程A").start();
        new Thread( r, "线程B").start();
    }
}